package com.wp.design.visit;

import com.google.common.collect.Lists;

import java.util.ArrayList;
import java.util.List;

public class Test {
	public static void main(String[] args) {
		List<Course> list = Lists.newArrayList();
		Course free = new FreeCourse();
		free.setName("java基础");
		CodeCourse code = new CodeCourse();
		code.setName("java设计模式");
		code.setPrice(588);

		list.add(free);
		list.add(code);

		for (Course item:list){
			item.accept(new VisitImpl());
		}
	}
}
